package com.gy.ai.agent.platform.siliconflow;


import com.gy.ai.agent.PlatformConfig;

/**
 * @author LGY
 * Create by 2025/6/16 11:36
 */
public class SiliconflowPlatformConfig extends PlatformConfig {

    private static final String DEFAULT_ENDPOINT = "https://api.siliconflow.cn/v1";

    public SiliconflowPlatformConfig() {
        this.setEndpoint(DEFAULT_ENDPOINT);
        this.initHeaders();
    }

    public SiliconflowPlatformConfig(String model, String apiKey) {
        this.setEndpoint(DEFAULT_ENDPOINT);
        this.setModel(model);
        this.setApiKey(apiKey);
        this.initHeaders();
    }

    public SiliconflowPlatformConfig(String model, String apiKey, String endpoint) {
        this.setEndpoint(endpoint);
        this.setModel(model);
        this.setApiKey(apiKey);
        this.initHeaders();
    }

    private void initHeaders() {
        this.addHeaders("Authorization", "Bearer " + this.getApiKey());
        this.addHeaders("Content-Type", "application/json");
    }
}
